unit uCryptUtils;

interface

uses
  uHWInfo,
  uRSACrypt,
  uTerminal,
  uHashUtils,
  SysUtils,
  uConstants,
  uOutputUtils;

function Sign_MD5(const AInputStr: string): string; stdcall;

implementation

function Sign_MD5(const AInputStr: string): string; stdcall;
var
  LPointID, LSystemTag: string;
begin
  try
    LPointID := GetPointID;
    if LPointID = 'test' then
      LSystemTag := '1234567890'
    else
      LSystemTag := GetSystemTag;
    Result := Sign_RSA_MD5_Base64(ExtractFilePath(ParamStr(0)) + 'Keys\terminal.key',
      MD5(LSystemTag + CRYPT_KEY),
      AInputStr);
  except
    on E: Exception do
    begin
      Result := '';
      AddToLog('Sign_MD5: ' + E.ClassName + ' ' + E.Message, 'AlfaPT', mtErr);
    end;
  end;
end;


end.
